package com.lcpress.service.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lcpress.entity.Article;
import com.lcpress.entity.User;
import com.lcpress.mapper.UserMapper;

@Service
public class Admin_UserOpServiceImpl implements IService<User>{
	
	@Autowired
	UserMapper uMapper;
	
	//登录 1登录成功  2密码错误  3账号错误
	public int userlogin(User uEntity) {
		
		if(uEntity.getUsername()=="luochao") {
			return 1;
		}
		
		return 3;
	}

	@Override
	public boolean saveBatch(Collection<User> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean saveOrUpdateBatch(Collection<User> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean updateBatchById(Collection<User> entityList, int batchSize) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean saveOrUpdate(User entity) {
		// TODO Auto-generated method stub
		return false;
	}
	
	//获取
	@Override
	public User getOne(Wrapper<User> queryWrapper, boolean throwEx) {
		
		User user=uMapper.selectOne(queryWrapper);
		
		return user;
	}

	@Override
	public Map<String, Object> getMap(Wrapper<User> queryWrapper) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <V> V getObj(Wrapper<User> queryWrapper, Function<? super Object, V> mapper) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BaseMapper<User> getBaseMapper() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Class<User> getEntityClass() {
		// TODO Auto-generated method stub
		return null;
	}
	

	
}
